<?php
/**
 * Created by PhpStorm.
 * User: idcu
 * Date: 2016/3/8
 * Time: 19:08
 */
namespace Service\Model;
use IDCU\Model\RelationModel;

class UserModel extends RelationModel
{
//    protected $connection = array(
//        'db_type'       =>  'mysql',
//        'db_host'       =>  'oa.sxqtwy.com',
//        'db_port'       =>  '3336',
//        'db_name'       =>  'TD_OA',
//        'db_user'       =>  'crm',
//        'db_pwd'        =>  '!@#sa2015',
//        'db_charset'    =>  'utf8',
//    );

    protected $tableName = 'oa_user';

//    protected $tablePrefix = '';
//
//    protected $dbName = 'zhkj_crm';

//    public function _initialize()
//    {
//        parent::_initialize(); // TODO: Change the autogenerated stub
//        $this->db_oa = M('User',null,'DB_OA');
//    }

    protected $_link = array(
        'Department' => array(
            'mapping_type'  => self::BELONGS_TO,
            'class_name'    => 'Department',
            'mapping_name'  => 'department',
            'foreign_key'   => 'DEPT_ID',
        ),
    );

    public function getUser($where){
        return $this->where($where)->select();
    }
}